<html>
<head><meta charset="utf-8"><title>Extending #[cfg] diagnostics to bodies · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html">Extending #[cfg] diagnostics to bodies</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214317261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214317261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214317261">(Oct 23 2020 at 14:04)</a>:</h4>
<p>Now that we diagnose inactive <code>#[cfg]</code>s on the item level, I'd like to extend this to bodies. One issue with this is that we cannot associate the diagnostic with the post-lowering <code>ExprId</code> etc., because those don't exist for unconfigured expressions/fields/etc., so this can't work like type check diagnostics. And storing <code>SyntaxNodePtr</code>s in the <code>Body</code> would invalidate it on every change that happens before the body in its file (right?).</p>
<p>Would it be a good idea to instead collect these diagnostics in the <code>BodySourceMap</code>? This already contains <code>SyntaxNodePtr</code>s so it shouldn't affect caching.</p>



<a name="214317526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214317526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214317526">(Oct 23 2020 at 14:06)</a>:</h4>
<p>Now that I think about it, I've added <code>SyntaxNodePtr</code>s to <code>CrateDefMap</code> for unconfigured items. That should probably be changed. I think I couldn't use <code>AstId</code> because I wanted something that erased the type of AST node, but that might be unnecessary.</p>



<a name="214323098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214323098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214323098">(Oct 23 2020 at 14:49)</a>:</h4>
<p><code>AstId</code> stores something erased interally</p>



<a name="214323215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214323215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214323215">(Oct 23 2020 at 14:50)</a>:</h4>
<p>For cfged-out expressions, perhaps we need just a special kind of expression? <code>Disable { what: Expr}</code>?</p>



<a name="214323256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214323256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214323256">(Oct 23 2020 at 14:50)</a>:</h4>
<p>hm, probably not the expression , but statement</p>



<a name="214324578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324578">(Oct 23 2020 at 15:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies/near/214323098">said</a>:</p>
<blockquote>
<p><code>AstId</code> stores something erased interally</p>
</blockquote>
<p>Yeah, I think I ignored that because it's not <code>pub</code></p>



<a name="214324665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324665">(Oct 23 2020 at 15:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies/near/214323256">said</a>:</p>
<blockquote>
<p>hm, probably not the expression , but statement</p>
</blockquote>
<p>The problem is that <code>#[cfg]</code>s can be on a lot more than just statements or expressions</p>



<a name="214324721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324721">(Oct 23 2020 at 15:02)</a>:</h4>
<p>It can be on fields and function call arguments for example</p>



<a name="214324726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324726">(Oct 23 2020 at 15:02)</a>:</h4>
<p>And on match arms</p>



<a name="214324758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324758">(Oct 23 2020 at 15:03)</a>:</h4>
<p>Riiight</p>



<a name="214324769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324769">(Oct 23 2020 at 15:03)</a>:</h4>
<p>It doesn't really sound very clean to add special cases to all of those just for one diagnostic</p>



<a name="214324828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324828">(Oct 23 2020 at 15:04)</a>:</h4>
<p>Well, I imagine that, if we have semantic model for disabled things, we can also provide best effort completion, for example</p>



<a name="214324886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324886">(Oct 23 2020 at 15:04)</a>:</h4>
<p>but yeah, this fundamentally goes against the grain of the language</p>



<a name="214324890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324890">(Oct 23 2020 at 15:04)</a>:</h4>
<p>true</p>



<a name="214324913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324913">(Oct 23 2020 at 15:04)</a>:</h4>
<p>so, it probably doesn't make sense to try to handle that at this stage</p>



<a name="214324966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324966">(Oct 23 2020 at 15:05)</a>:</h4>
<p>Yeah, I guess we should just stuff the info in the SourceMap</p>



<a name="214324976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214324976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214324976">(Oct 23 2020 at 15:05)</a>:</h4>
<p>We should probably also have some more incrementality tests for this sort of stuff, since otherwise we'd almost never notice these subtle problems (ItemTree is also missing these)</p>



<a name="214327165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214327165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214327165">(Oct 23 2020 at 15:22)</a>:</h4>
<p>It's kinda hard to make a general incremental tests here though, which would trigger when we make unexpected changes.</p>



<a name="214327935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214327935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214327935">(Oct 23 2020 at 15:29)</a>:</h4>
<p>Yeah, it's a bit tricky. But something like "prepending a newline to this file doesn't invalidate item bodies" seems like a useful thing to test for.</p>



<a name="214327979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214327979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214327979">(Oct 23 2020 at 15:29)</a>:</h4>
<p>If something does break a test like that at least we won't <em>accidentally</em> regress it</p>



<a name="214328116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328116">(Oct 23 2020 at 15:30)</a>:</h4>
<p>For the item tree this seems fairly useful, because its entire point is to avoid reparsing stuff, so that should be easy-ish to check</p>



<a name="214328181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328181">(Oct 23 2020 at 15:31)</a>:</h4>
<p>Item tree is indirectly checked by nameres</p>



<a name="214328225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328225">(Oct 23 2020 at 15:31)</a>:</h4>
<p>Oh, did we add a test for that?</p>



<a name="214328445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328445">(Oct 23 2020 at 15:33)</a>:</h4>
<p><code>typing_inside_a_macro_should_not_invalidate_def_map</code></p>



<a name="214328582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328582">(Oct 23 2020 at 15:34)</a>:</h4>
<p>Yeah, although that predates ItemTree</p>



<a name="214328621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328621">(Oct 23 2020 at 15:34)</a>:</h4>
<p>It doesn't check that the ItemTree actually avoids parsing the source file twice</p>



<a name="214328737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328737">(Oct 23 2020 at 15:35)</a>:</h4>
<p>"Parsing twice" in a sense "not redo the same work for impls" is not something this test is intended to test</p>



<a name="214328796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328796">(Oct 23 2020 at 15:36)</a>:</h4>
<p>"Parsing twice" is re-parsing after source code change I think is inevitable?</p>



<a name="214328827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328827">(Oct 23 2020 at 15:36)</a>:</h4>
<p>That's sort of how item tree works -- we re-parse and rebuild it, but we stop there, a the tree is not changed</p>



<a name="214328927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214328927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214328927">(Oct 23 2020 at 15:37)</a>:</h4>
<p>Yeah, but previously we'd reparse the input twice, once for nameres, and once for item data queries</p>



<a name="214329066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214329066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214329066">(Oct 23 2020 at 15:38)</a>:</h4>
<p>I suppose it would not really be testing incrementality</p>



<a name="214329220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214329220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214329220">(Oct 23 2020 at 15:40)</a>:</h4>
<p>correct, it'll be testing LRU capacity</p>



<a name="214329275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214329275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214329275">(Oct 23 2020 at 15:40)</a>:</h4>
<p>Though, yeah, I guess we can actully test this</p>



<a name="214329316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Extending%20%23%5Bcfg%5D%20diagnostics%20to%20bodies/near/214329316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Extending.20.23.5Bcfg.5D.20diagnostics.20to.20bodies.html#214329316">(Oct 23 2020 at 15:40)</a>:</h4>
<p>At least in theory, something like <code>typing_inside_function_body_doesn't recompute crate_impls</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>